package com.onegroup.common.utils;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * @author: 曾雪斌
 * @Description: 将字符串渲染到客户端
 * @History:
 */
public class WebUtil {

    public static String renderString(HttpServletResponse response, String str) {
        response.setStatus(200);
        response.setContentType("application/json");
        response.setCharacterEncoding("UTF-8");
        try {
            response.getWriter().print(str);
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
        return null;
    }
}
